<!DOCTYPE html>
<html>
<#include "../head.html">
    <body class="full">
    <div class="mc">
        <div>
            <div class="mc-l">
                <!--左侧导航---{-->
                <div id="navPanelContainer">
                    <div class="system-logo cd"></div>
                    <!--管理员信息---{-->
                    <#include "../adminInfo.html">
                        <!--管理员信息---}-->
                        <div class="nav-wrap">
                            <#include "left.html">
                        </div>
                </div>
                <!--左侧导航---}-->
            </div>
            <div class="mc-m">
                <div class="navToggle"></div>
            </div>
            <div class="mc-r">
                <!--顶部导航---{-->
                <#include "../topNav.html">
                    <!--顶部导航---}-->

                    <!--面包屑导航---{-->
                    <#assign moduleName="投资统计(渠道)">
                        <#include "banner.html">
                            <!--面包屑导航---}-->

                            <!--工具栏--{-->
                            <div id="toolbar" class="clearfix">
                                <div class="toolbor-module export">
                                    <a href="importActive.html" class="input-button">激活数导入</a>
                                </div>
								<div class="toolbor-module search">
                    				<input type="button" value="搜索"  class="input-button" onclick="sousuo();">
                				</div>
                                <div class="toolbor-module search">
                                    <div class="formTit">渠道类型：</div>
                                    <select name="sourcesType" id="sourcesType">
                                        <option value="" >所有</option>
                                        <#list sourcesType as item>
                                            <option value="${item}">${item}</option>
                                        </#list>
                                    </select>
                                </div>
                                <div class="toolbor-module search">
                                    <div class="formTit">渠道：</div>
                                    <select name="source" id="source">
                                        <option value="" >所有</option>
                                        <#list sources as item>
                                            <!-- <#assign name = item.name /> -->
                                            <option value="${item.name}">${item.name}</option>
                                        </#list>
                                        <option value="" >自然-1</option>
                                        <option value="" >自然-2</option>
                                    </select>
                                </div>
                                <div class="toolbor-module search">
                                    <div class="formTit"> 到 </div>
                                    <input class="_search-value" name="endDate" id="endDate" value="${endTime}"  onclick="change_picktime('yyyy-MM-dd')"/>
                                </div>
                                <div class="toolbor-module search">
                                    <div class="formTit">日期：</div>
                                    <input class="_search-value" name="startDate" id="startDate" value="${startTime}" onclick="change_picktime('yyyy-MM-dd')"/>
                                </div>
                            </div>
                            <!--工具栏--}-->
                            <div id="main" class="clearfix">
                                    <table class="data-list">
                                        <tr class="header">
                                            <td>渠道名称</td>
                                            <td>渠道类型</td>
                                       		<td>激活数</td>
                                            <td>注册数</td>
                                            <td>注册率</td>
                                            <td>实名认证</td>
                                            <td>认证率</td>
                                            <td>投资人数</td>
                                            <td>首投人数</td>
                                            <td>首投金额</td>
                                            <td>投资总额</td>
                                            <td>首投占比</td>
                                            <td>人均投资</td>
                                            <td>平均期限</td>
                                            <td>年化投资额</td>
                                        </tr>
                                        <#if list?? && (list?size) gt 0 >
                                        	<#list list as item>
                                        	
                                        	<#if item.activeNum gt 0>
                                        	<#assign a=item.registerNum/item.activeNum*100/><!-- 注册率 -->
                                        	<#else><#assign a=0/>
                                        	</#if>
                                        	
                                        	<#if item.registerNum gt 0>
                                        	<#assign b=item.realNameNum/item.registerNum*100/><!-- 实名认证率 -->
                                        	<#else><#assign b=0/>
                                        	</#if>
                                        	
                                        	<#if item.investmentNum gt 0>
                                        	<#assign c=item.newInvestmentNum/item.investmentNum*100/><!--首投率  --> 
                                        	<#else><#assign c=0/>    
                                        	</#if>  
                                        	       
                                        	<#if item.investmentNum gt 0>                          	
                                        	<#assign e=item.investmentTotal/item.investmentNum/><!-- 人均投资-->
                                        	<#else><#assign e=0/>
                                        	</#if>
                                        	<#assign f=(item.sourceAvgLimit/30)?string('0.00')/><!-- 平均期限-->
                                            <tr class="s">
                                                <td>${item.sourceFrom}</td>
                                                <td>${item.selectTime}</td>
                                                <td>${item.activeNum?c}</td>
                                                <td>${item.registerNum}</td>
                                                <td>${a?string('0.00')}%</td>
                                                <td>${item.realNameNum}</td>
                                                <td>${b?string('0.00')}%</td>
                                                <td>${item.investmentNum}</td>
                                                <td>${item.newInvestmentNum}</td>
                                                <td>${item.newInvestmentAccount?c}</td>
                                                <td>${item.investmentTotal?c}</td>                                       
                                                <td>${c?string('0.00')}%</td>
                                                <td>${e?string('0.00')}</td>
                                                <td>${f}月</td>
                                                <td>${item.sourceYearInvestment?string('0.00')}</td>                                                                                                                                           
                                            </tr>
                                        	</#list>
                                         </#if>
                                    </table>

                                <!--底部工具栏--{-->
                                <div id="bottomToolbar" class="clearfix">
                                    <div class="other-tool">
                                        <dl class="refresh-data">
                                            <dt class="refresh-data-icon"></dt>
                                            <dd><a href="javascript:void(0);" class="refresh-page">刷新数据</a></dd>
                                        </dl>
                                    </div>

                                    <!--翻页系统--{-->
                                    <div class="container s_formPage">
                                        <#import "../../common/page.html" as pager>
                                            <@pager.pagination page=page url="${pageUrl}" map=param style="style1" />
                                    </div>
                                    <!--翻页系统--}-->
                                </div>
                                <!--底部工具栏--}-->
                                <script src="${request.getContextPath()}/themes/sortjs/jquery-latest.min.js"></script> 
								<script src="${request.getContextPath()}/themes/sortjs/jquery.tablesort.min.js"></script> 
								<script type="text/javascript">
										$(function(){
											$('table.data-list').tablesort().data('tablesort');
											$('.number').data('sortBy', function(th, td, sorter) {
												/* return parseInt(td.text(), 10); */
												return parseFloat(td.text());
											}); 
										});
								</script>

                                <script>
                                    var url = 'queryBySource.html?search=true';

                                    function sousuo(){
                                        var sou = "";
                                       
                                    	
                   					  	var startDate = $("#startDate").val();
                                        var endDate = $("#endDate").val();
                                       var source=$("#source").val(); 
                                       var sourcesType=$("#sourcesType").val();
                                      
                                        
                                         if (startDate!=null){
                                             sou += "&startTime="+startDate;
                                         }
                                         if (endDate!=null){
                                             sou += "&endTime="+endDate;
                                         }
                                         if(source!=null){
                                        	 sou += "&sourceFrom="+source;
                                         }
                                         if(sourcesType!=null){
                                        	 sou +="&sourcesType="+sourcesType;
                                         }
                                                                                                                                                                                                                                               
	                                     if (sou!=""){
	                                            location.href=url+sou;
	                                     }
                                    }
                              
                                </script>
                            </div>

            </div>
        </div>
        <div class="mc-b">
            <#include "../foot.html">
        </div>
    </div>
    <#include "../jsPage.html">
    </body>
</html>

